/**
 * Created by Lenovo on 30/11/2020.
 */
/*
* 验证手机号码
* */
function isPhoneNo(phone) {
    var pattern = /^1[123456789]\d{9}$/;
    return pattern.test(phone);
}

/**
 * 验证邮箱
 * @param email
 * @returns {boolean}
 */
function isEmail(email) {
    var email_reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    return email_reg.test(email);
}

// 定时器
var wait = 180;
get_code_time = function (o) {
    if (wait == 0) {
        o.removeAttribute("disabled");
        o.value = "获取验证码";
        wait = 180;
    } else {
        o.setAttribute("disabled", true);
        o.value = "(" + wait + ")秒后重新获取";
        wait--;
        setTimeout(function () {
            get_code_time(o)
        }, 1000)
    }
};